package com.example.everying.controller.appeal;/*
 * 项目名称: everything
 * 文件名: AppealController
 * 作者: 张泽阳
 * 日期: 2025/6/20
 * 描述:
 */

import com.example.everying.annotation.WebLog;
import com.example.everying.model.dto.appeal.*;
import com.example.everying.model.entity.appeal.AppealEvidence;
import com.example.everying.service.appeal.AppealEvidenceService;
import com.example.everying.service.appeal.AppealRecordService;
import com.example.everying.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/appeal")
public class AppealController {

    @Autowired
    private AppealEvidenceService appealEvidenceService;

    @Autowired
    private AppealRecordService appealRecordService;

    @WebLog(description = "用户申诉")
    @PostMapping("/addAppeal")
    public Result<?> addAppeal(@RequestBody AddAppealDto addAppealDto){

        return appealEvidenceService.addAppeal(addAppealDto);
    }

    @WebLog(description = "用户新增申诉凭证")
    @PostMapping("/appEvidence")
    public Result<?> appEvidence(@RequestBody AddEvidenceDto addEvidenceDto){

        return appealEvidenceService.addEvidence(addEvidenceDto);
    }

    @WebLog(description = "获取申请记录")
    @PostMapping("/getAppealEvidence")
    public Result<?> getAppealEvidenceList(@RequestBody GetAppealEvidenceDto getAppealEvidenceDto){
        return appealEvidenceService.getAppealEvidenceList(getAppealEvidenceDto);
    }
    @WebLog(description = "撤销申诉")
    @PostMapping("/cancelAppeal")
    public Result<?> cancelAppeal(@RequestBody CancelAppealDto cancelAppealDto){
        return appealEvidenceService.cancelAppeal(cancelAppealDto);
    }


    @WebLog(description = "后台客服审核凭证")
    @PostMapping("/checkAppealEvidence")
    public Result<?> checkAppealEvidence(@RequestBody CheckAppealEvidenceDto checkAppealEvidenceDto){
        return appealEvidenceService.checkAppealEvidence(checkAppealEvidenceDto);
    }

    @WebLog(description = "后台申诉记录列表")
    @PostMapping("/page")
    public Result<?> getAppealRecordList(@RequestBody AppealRecordPageDto appealRecordPageDto){
        return appealRecordService.getAppealRecordList(appealRecordPageDto);
    }




}
